﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Homework1
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Please enter the first number:");
            String a = Console.ReadLine();
            Console.WriteLine("Please enter the symbol:(+-*/):");
            String b = Console.ReadLine();
            Console.WriteLine("Please enter the second number:");
            String c = Console.ReadLine();
            try
            {
                if (b == "+")
                {
                    Console.WriteLine((double.Parse(a) + double.Parse(c)).ToString());
                }
                else if (b == "*")
                {
                    Console.WriteLine(double.Parse(a) * double.Parse(c));
                }
                else if (b == "-")
                {
                    Console.WriteLine(double.Parse(a) - double.Parse(c));
                }
                else if (b == "/")
                {
                    Console.WriteLine(double.Parse(a) / double.Parse(c));
                }
                else
                {
                    Console.WriteLine("Syntax Error! Please check the input!");
                }
            }
            catch (Exception)
            {
                Console.WriteLine("Error occured! Please check the input!");
            }
            
            Console.ReadKey();


        }
    }
}
